<!-- 带时间戳的图片组件 与PC 一样 -->
<template>
    <div v-show="showText">
        <img :src="props.src" :alt="props.alt" @load="handleLoad" @error="handleError" >
        <div v-if="props.text && showText" class="img_text">{{ props.text }}</div>
    </div>
</template>

<script setup lang='ts' name="ImgText">
import { ref } from 'vue';
const props: any = defineProps({
    src: {
        type: String,
        default: ''
    },
    alt: {
        type: String,
        default: 'img'
    },
    text: {
        type: String,
        default: ''
    },
    lazy: {
        type: Boolean,
        default: true
    },
})

const showText = ref(false)

const handleLoad = () => {
    showText.value = true
}

const handleError = () => {
    showText.value = true
}
</script>

<style lang="scss"></style>